#pragma once
//============================================================================
// Copyright (C) 2013 Brett R. Jones
//
// Issued to public domain 2013
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================
#include "VxDefs.h"
#include "VxInetAddress.h"
#ifdef WIN_PLATFORM
	#ifndef FD_SET
		#include <WinSock2.h> // windows socket definitions
	#endif
#endif

class VxSktCode
{
public:
	RCODE m_rcLastError;

	VxSktCode();
	virtual ~VxSktCode();



	//! Connect to 
	virtual SOCKET			ConnectTo(	VxInetAddress&		oLclIp,
										VxInetAddrAndPort&	oRmtIp,
										const char *		pIpOrUrl,						// remote ip or url
										U16					u16Port,						// port to connect to
										int					iTimeoutMilliSeconds = 8000);	// timeout attempt to connect

	virtual RCODE			getRmtAddress( SOCKET& oSkt, VxInetAddrAndPort& oRetAddr );

	virtual RCODE			getLclAddress( SOCKET& oSkt, VxInetAddrAndPort& strLclIpAddr );
};
